package MazeSolver;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class MazeButtonController implements ActionListener{

	private MazeView view;
	private MazeModel model;
	
	public MazeButtonController(MazeView mazeView, MazeModel model) {
		view = mazeView;
		this.model = model;
	}

	@Override
	public void actionPerformed(ActionEvent ae) {
		if(ae.getSource().equals(view.getSolveButton())) {
			model.reset();
			model.solve();
		}
	}

}
